/**
 * 加密数据
 * @param {type} message 待加密的字符串
 * @param {type} key 秘钥
 * @returns {unresolved} 加密后的数据
 */
function encryptByAes(message, key) {
	var sendData = CryptoJS.enc.Utf8.parse(message);
    var key = CryptoJS.MD5(key);
    var encrypted = CryptoJS.AES.encrypt(sendData, key,{iv:key,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Iso10126});
    return encrypted.toString();
} 

var aceJs = [];
aceJs.push(window.global.acePath+'/assets/js/ace-extra.min.js');
aceJs.push(window.global.acePath+'/assets/js/jquery-ui.custom.min.js');
aceJs.push(window.global.acePath+'/assets/js/jquery.ui.touch-punch.min.js');
aceJs.push(window.global.acePath+'/assets/js/ace-elements.min.js');
aceJs.push(window.global.acePath+'/assets/js/ace.min.js');

//$script(aceJs, 'ace');

var indexJs = [];
indexJs.push(window.global.plugin+'/dialog/layer/dist/layer.js');
indexJs.push(window.global.plugin+'/form/jQuery-Validation-Engine/js/languages/jquery.validationEngine-zh_CN.js');
indexJs.push(window.global.plugin+'/form/jQuery-Validation-Engine/js/jquery.validationEngine.js');
indexJs.push(window.global.plugin+'/form/jquery.form.js');
indexJs.push(window.global.ctx+'/static/fw/js/tag.value.control.js');
indexJs.push(window.global.ctx+'/static/fw/js/jquery.mailAutoComplete-3.1.js');
indexJs.push(window.global.ctx+'/static/fw/js/fw-form.js');
indexJs.push(window.global.ctx+'/static/fw/js/fw-pagecontext.js');


//$script.ready('ace', function() {
// 
//})
function loadCryptJs(){
	$script(window.global.plugin+'/crypt/cryptoJS/components/core-min.js','crypt-core', function() {
		$script(window.global.plugin+'/crypt/cryptoJS/components/md5-min.js','crypt-md5', function() {
			$script(window.global.plugin+'/crypt/cryptoJS/rollups/aes.js','crypt-aes', function() {
				$script(window.global.plugin+'/crypt/cryptoJS/components/pad-iso10126-min.js', 'crypt-iso10126');
			});
		});
	});
	//$script(window.global.plugin+'/jsrsasign/jsrsasign-all-min.js', 'keyutil');
	//$script(window.global.plugin+'/jsrsasign/ext/base64-min.js', 'base64');
	//$script(window.global.plugin+'/jsrsasign/ext/rsa-min.js', 'rsa');
	
}